% This code evaluates the model fit
function [fit_off_st, fit_off_ist] = report_baseline(enrollment_eq, non_converge, solve_market,...
    D, K, N, D_enroll_st)

% percent threshold to evaluate the model fit
xxx=3;

% enrollment fit 
enroll_delta_st = 100*(enrollment_eq-D_enroll_st)./D_enroll_st; 
flag_st = (abs(enroll_delta_st)>xxx);
fit_off_st = (solve_market==1 & non_converge==0 & flag_st==1);

fit_off_ist = zeros(N.ist,1);
for ii=1:N.ist
    mkt_ii = D.mkt(ii);
    fit_off_ist(ii) = fit_off_st(mkt_ii);
end
